﻿using System.Collections.Generic;
using System.Threading.Tasks;
using Jinjia.Approve.Model.Input.JJFlow;
using Jinjia.Approve.Model.VM.JJFlow;
using Jinjia.Approve.Model.VM.JJFlow.DTO;
using Jinjia.Approve.Model.VM.JJFlow.Request;
using Jinjia.Core.BaseInfrastructure.StorageModel.Model;

namespace Jinjia.Approve.IService.JJFlow
{
    public interface IJJFlowClientService
    {
        /// <summary>
        /// 获取模板ID
        /// </summary>
        /// <param name="modular_key"></param>
        /// <returns></returns>
        Task<int> GetTemplateID(string modular_key);

        /// <summary>
        /// 获取 Instance
        /// </summary>
        /// <param name="modular_key">模块Key</param>
        /// <param name="biz_order_id">业务ID</param>
        /// <returns></returns>
        Task<JjFlowInstanceVM> GetInstanceInfo(string modular_key, string biz_order_id);

        /// <summary>
        /// 通过
        /// </summary>
        /// <param name="flow_instance_id"></param>
        /// <param name="user_id"></param>
        /// <param name="remark"></param>
        /// <param name="is_auto_approve"></param>
        /// <returns></returns>
        Task<NodeInfo> Approve(int flow_instance_id, int user_id, string remark, int is_auto_approve = 0);

        /// <summary>
        /// 待我审核数据
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        Task<List<string>> GetUserBizOrderId(QueryRequest request);

        /// <summary>
        /// 首页-待办 汇总页（本质是待我审的单据）
        /// </summary>
        /// <param name="currentUserId"></param>
        /// <param name="input"></param>
        /// <returns></returns>
        Task<PageListSearchResultVM<MyTodoListOverview>> GetMyTodoListOverview(int currentUserId, SearchConditionBaseInput input);
        /// <summary>
        /// 当前用户的id
        /// </summary>
        /// <param name="currentUserId"></param>
        /// <returns>汇总待办的总个数</returns>
        Task<int> GetMyTodoListCount(int currentUserId);
        /// <summary>
        /// 首页 待办 详情页
        /// </summary>
        /// <param name="currentUserId"></param>
        /// <param name="input"></param>
        /// <returns></returns>
        Task<PageListSearchResultVM<MyTodoListDetail>> GetTodoListDetailForCurrentUser(int currentUserId, GetToDoListDetailByTab input);
        /// <summary>
        /// 通过url检索页面信息
        /// </summary>
        /// <param name="url"></param>
        /// <returns></returns>
        Task<IReadOnlyList<SearchByUrlResponse>> SearchByUrl(string url);

        /// <summary>
        /// 根据Id集合获取审批单据列表
        /// </summary>
        /// <param name="IdList"></param>
        /// <returns></returns>
        Task<List<JjFlowInstanceVM>> GetInstanceListByIdsAsync(List<int> IdList);
    }
}